<?php
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

require DISCUZ_ROOT.'./source/function/function_mail.php';
require DISCUZ_ROOT.'./source/function/function_date.php';

$todays = strtotime(date('Y-m-d', date()));

$id =  $_G['gp_id'];
$ut =  $_G['gp_update_time'];
if(!empty($id) && !empty($ut)){
	$data = array('unsubscribe' => 1, 'unsubscribe_day' => $todays);
	$row_count = DB::update('article_subscribe', $data, array('id' => $id, 'update_time' => $ut));
	if ($row_count > 0) {
		showmessage(lang('know/template', 'unsubscribe_success'));
	}
	else {
		showmessage(lang('know/template', 'unsubscribe_fail'));
	}
}
else {
	showmessage(lang('know/template', 'unsubscribe_fail'));
}
?>